
    <ul>
      <?php foreach($data['allApparts'] as $k1=>$v1): ?>
        <li id="<?php echo $v1->cha_id; ?>"> 
        <span class='main-site-globalbo-moduleSpace-flat-result-immeuble'><?php echo $v1->FrbFlatImmeuble->imm_nom; ?></span>
        <span class='main-site-globalbo-moduleSpace-flat-result-chambre'><?php echo $v1->cha_num; ?></span>
        <span style='display:none' class='main-site-globalbo-moduleSpace-flat-result-chambre-lowloy'><?php echo $v1->cha_loy_low; ?></span>
        <span style='display:none' class='main-site-globalbo-moduleSpace-flat-result-chambre-highloy'><?php echo $v1->cha_loy_high; ?></span>
        <span style='display:none' class='main-site-globalbo-moduleSpace-flat-result-chambre-surface'><?php echo $v1->cha_surf; ?></span>
        <span style='display:none' class='main-site-globalbo-moduleSpace-flat-result-chambre-desc'><?php echo $v1->cha_det; ?></span>
        
        <span style='display:none' class='main-site-globalbo-moduleSpace-flat-result-ville'><?php echo $v1->FrbFlatImmeuble->FrbFlatVille->vil_nom; ?></span>        
        </li>
      <?php endforeach; ?>
    </ul>
    
<script type="text/javascript">

/**  affiche le détail d'un appartement via la li**/
$('#main-site-globalbo-moduleSpace-flat-result li').click(function(){
  thisClick = $(this);
  $('.result-activeli').attr('class', '');
  thisClick.attr('class', 'result-activeli');
  $('#main-site-globalbo-moduleSpace-flat-detail').fadeOut('slow', function(){
    var ville = thisClick.children('main-site-globalbo-moduleSpace-flat-result-ville').html();
    var immeuble = thisClick.children('.main-site-globalbo-moduleSpace-flat-result-immeuble').html();
    var appart = thisClick.children('.main-site-globalbo-moduleSpace-flat-result-chambre').html();
    var idappart = thisClick.attr('id');
    var low_loy = thisClick.children('.main-site-globalbo-moduleSpace-flat-result-chambre-lowloy').html();
    //var high_loy = thisClick.children('.main-site-globalbo-moduleSpace-flat-result-chambre-highloy').html();
    var description = thisClick.children('.main-site-globalbo-moduleSpace-flat-result-chambre-desc').html();
    var surface = thisClick.children('.main-site-globalbo-moduleSpace-flat-result-chambre-surface').html();;

    $('#main-site-globalbo-moduleSpace-flat-detail #main-site-globalbo-moduleSpace-flat-detail-immeuble').html(immeuble);
    $('#main-site-globalbo-moduleSpace-flat-detail #main-site-globalbo-moduleSpace-flat-detail-chambre').html(appart);
    $('#main-site-globalbo-moduleSpace-flat-detail #main-site-globalbo-moduleSpace-flat-detail-lowLoy').html(low_loy);
    //$('#main-site-globalbo-moduleSpace-flat-detail #main-site-globalbo-moduleSpace-flat-detail-highLoy').html(high_loy);
    $('#main-site-globalbo-moduleSpace-flat-detail #main-site-globalbo-moduleSpace-flat-detail-surface').html(surface);
    $('#main-site-globalbo-moduleSpace-flat-detail #main-site-globalbo-moduleSpace-flat-detail-description').html(description);
    $('#main-site-globalbo-moduleSpace-flat-detail .main-site-globalbo-moduleSpace-flat-detail-modif').attr('id', 'appart_'+idappart);
    $('#main-site-globalbo-moduleSpace-flat-detail #appart_id_modif').val('appart_'+idappart);
    loadPictures(idappart);
  });
  $('#main-site-globalbo-moduleSpace-flat-detail').fadeIn('slow');
});
</script>